//
//  DiscoverButtonCell.m
//  Coco_Music
//
//  Created by 强哥 on 15/6/25.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "DiscoverButtonCell.h"

@implementation DiscoverButtonCell

-(void)dealloc
{
    [self.SongInfo release];
    [self.SpecialInfo release];
    [self.NewSpecial release];
    [self.SongLabel release];
    [self.SingerLabel release];
    [self.pick_count release];
    [self.NB release];
    [self.number release];
    [self.ImageLine release];
    [super dealloc];
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creation];
    }
    return self;
}
//单曲自定义cell(singer与single替换了)
-(void)creation
{
    self.SongLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, 10, 250, 30)];
    self.SongLabel.font =[UIFont fontWithName:@"Menlo-Bold" size:18];
    self.SingerLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.SongLabel.frame.origin.x, self.SongLabel.frame.origin.y+30, 250, 30)];
    self.SingerLabel.textColor = [UIColor lightGrayColor];
    self.number = [[UILabel alloc]initWithFrame:CGRectMake(30, 35, 30, 30)];
    self.number.font = [UIFont fontWithName:@"Menlo-Bold" size:19];
    
    self.ImageLine = [[UIImageView alloc]initWithFrame:CGRectMake(_number.frame.size.width+20, self.bounds.origin.y, [UIScreen mainScreen].bounds.size.width-_number.frame.size.width-40, 1)];
    _ImageLine.backgroundColor = [UIColor lightGrayColor];
    
    [self.contentView addSubview:_ImageLine];
    [self.contentView addSubview:_number];
    [self.contentView addSubview:_SongLabel];
    [self.contentView addSubview:_SingerLabel];
    [_SongLabel release];
    [_SingerLabel release];
    [_number release];
}

-(void)setSongInfo:(NewSong *)SongInfo
{
    if (_SongInfo != SongInfo) {
        [_SongInfo release];
        _SongInfo = [SongInfo retain];
    }
    self.SingerLabel.text = SongInfo.singer_name;
    self.SongLabel.text = SongInfo.song_name;
    
}

-(void)setNB:(NSString *)NB
{
    if (_NB!= NB) {
        [_NB release];
        _NB = [NB retain];
    }
    self.number.text = NB;
    
}

-(void)setSpecialInfo:(SearchSpecial *)SpecialInfo
{
    if (_SpecialInfo != SpecialInfo) {
        [_SpecialInfo release];
        _SpecialInfo = [SpecialInfo retain];
    }
    self.SingerLabel.text = SpecialInfo.singer_name;
    self.SongLabel.text = SpecialInfo.song_name;
}

-(void)setNewSpecial:(NewSong *)NewSpecial
{
    if (_NewSpecial != NewSpecial) {
        [_NewSpecial  release];
        _NewSpecial = [NewSpecial retain];
    }
    
    self.SingerLabel.text = NewSpecial.singer_name;
    self.SongLabel.text = NewSpecial.song_name;
    
}











/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
